# 导包
import pytest

from api.order_setting_service_api import OrderSettingServiceApi
from data.health_data import order_add_data, order_setting_data


class TestOrderSettingService:

    def setup(self):
        # 实例化MemberServiceApi类
        self.ms = OrderSettingServiceApi()

    @pytest.mark.parametrize("p", order_add_data)
    def test_add(self, p):
        # 通过invoke函数来访问接口-服务名、函数名、参数

        list1 = p["list1"]
        res = self.ms.add(list1)

        # 断言
        assert res == p["exp"]

    @pytest.mark.parametrize("p", order_setting_data)
    def test_edi_number_by_date(self, p):
        ordersetting = p["ordersetting"]

        # 使用实例，调用invoke（服务名、函数名、实参）
        res = self.ms.edit_number_by_date(ordersetting)

        # 断言
        assert res == p["exp"]
